package com.chen.bean;

public class Result<T> {
    private Integer code;

    private String message;

    private T t;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getT() {
        return t;
    }

    public void setT(T t) {
        this.t = t;
    }

    public Result(){

    }

    public Result(Integer code,String message,T t){
        this.code=code;
        this.message=message;
        this.t=t;
    }

    public static Result success(Object obj){
        return new Result(0,"成功",obj);
    }

    public static Result error(Integer code,String message,Object obj){
        return new Result(code,message,obj);
    }
}
